import type { CreateCrudOptionsRet } from '@fast-crud/fast-crud';

import { DefTenantApi } from '#/api';
import { $t } from '#/locales';

export function createCrudOptions(): CreateCrudOptionsRet {
  return {
    crudOptions: {
      request: { editRequest: DefTenantApi.updateStatusRequest },
      form: { labelWidth: '250px', mode: 'edit', col: { span: 24 } },
      columns: {
        id: {
          title: 'ID',
          type: 'text',
          form: { show: false },
        },
        status: {
          title: 'status',
          type: 'text',
          form: { show: false },
        },
        name: {
          title: $t('devOperation.tenant.defTenant.name'),
          type: 'text',
          form: { component: { readonly: true } },
        },
      },
    },
  };
}
